package com.learn.spring.java_config;

import com.learn.spring.bean.Dog;
import com.learn.spring.bean.Person;
import com.learn.spring.postprocessor.MyBeanFactoryPostProcessor;
import com.learn.spring.postprocessor.MyBeanPostProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;

/**
 * @author wangxing
 * @version 2020/6/12 12:04 Administrator
 */
@Configuration
public class MainConfig {
    @Bean(name = "person")
    public Person getPerson() {
        return new Person();
    }
//    添加bean后置处理器到Spring中
    @Bean
    public MyBeanPostProcessor getMyBeanPostProcessor(){
        return new MyBeanPostProcessor();
    }
    @Bean
    public MyBeanFactoryPostProcessor getMyBeanFactoryPostProcessor(){
        return new MyBeanFactoryPostProcessor();
    }
}
